package com.todo.content.infrastructure.helper.es.entity;

import com.todo.component.es.entity.BaseESEntity;
import lombok.Data;
import org.dromara.easyes.annotation.HighLight;
import org.dromara.easyes.annotation.IndexField;
import org.dromara.easyes.annotation.IndexName;
import org.dromara.easyes.annotation.Settings;
import org.dromara.easyes.annotation.rely.Analyzer;
import org.dromara.easyes.annotation.rely.FieldType;

/**
 * @author azhebuxing
 * @date 2024/12/11 17:03
 * @description
 */
@Data
@Settings(shardsNum = 3, replicasNum = 2)
@IndexName(value = "content_detail")
public class ContentDetailEntity extends BaseESEntity {

    /**
     * 用户id
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private Long userId;
    /**
     * 内容标题
     */
    @IndexField(fieldType = FieldType.TEXT)
    private String title;
    /**
     * 内容信息
     */
    @HighLight(preTag = "<em style='color:red'>", postTag = "</em>")
    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_MAX_WORD)
    private String content;
    /**
     * 主图
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String mainImg;
    /**
     * 分类code
     */
    @IndexField(fieldType = FieldType.KEYWORD)
    private String classifyCode;
    /**
     * 当前状态
     * {@link }
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer status;
    /**
     * 是否私有
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer isPrivate;
    /**
     * 是否允许评论
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer allowComment;
    /**
     * 浏览数
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer seeCount;
    /**
     * 点赞数
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer likeCount;
    /**
     * 评论数
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer commentCount;
    /**
     * 收藏量
     */
    @IndexField(fieldType = FieldType.INTEGER)
    private Integer collectCount;
}
